package tech.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.Post;
import tech.aistar.entity.UserInfo;
import tech.aistar.mapper.massage.SearchMapper;
import tech.aistar.service.ISearchService;

import java.util.List;

@Service
@Transactional
public class SearchServiceImpl implements ISearchService {
    @Autowired
    private SearchMapper searchMapper;
    @Override
    public List<Post> selPost(String title) {
        List<Post> posts = searchMapper.selPost(title);
        return posts;
    }

    @Override
    public List<Post> selPosts(String postContent) {
        List<Post> posts = searchMapper.selPosts(postContent);
        return posts;
    }

    @Override
    public List<UserInfo> selUser(String uName) {
        List<UserInfo> userInfos = searchMapper.selUser(uName);
        return userInfos;
    }

    @Override
    public UserInfo selQUser(String uId) {
        UserInfo userInfo = searchMapper.selQUser(uId);
        return userInfo;
    }
}
